1. Field of the Invention
The present invention relates to the testing of microprocessors. It more specifically relates to a device and a method for transmitting from a monitoring circuit integrated in a microprocessor chip dated digital messages enabling tracing the microprocessor operation.
2. Discussion of the Related Art
FIG. 1 schematically shows an integrated circuit 10 comprising a microprocessor (μP) 12, an internal memory (MEM) 14, and input/output terminals (I/O) 16. Microprocessor 12 is intended to execute a program or a software stored in memory 14. Under control of the program, microprocessor 12 may process data provided by input/output terminals 16 or stored in memory 14 and read or write data through input/output terminals 16.
To check the proper operation of the microprocessor, a monitoring circuit 18 (TEST) is generally integrated to integrated circuit 10. Monitoring circuit 18 is capable of reading specific data provided by microprocessor 12 on execution of a program, and of possibly processing the read data. Test terminals 22 connect monitoring circuit 18 to an analysis tool 24. Analysis tool 24 may process the received signals, for example, according to commands provided by a user, and ensure a detailed analysis of the operation of microprocessor 12. In particular, analysis tool 24 may determine the program instruction sequence really executed by microprocessor 12.
The number of test terminals 22 may be on the same order of magnitude as the number of input/output terminals 16, for example, 200 to 400 terminals. Test terminals 22 as well as the connections of monitoring circuit 18 take up a significant silicon surface area, which causes an unwanted increase in the circuit cost. For this purpose, a first version of integrated circuit 10 comprising monitoring circuit 18 and test terminals 22 is produced in small quantities to debug the program of microprocessor 12 or “user program”. After this debugging, a version of integrated circuit 10 rid of monitoring circuit 18 and of test terminals 22 is sold. This requires forming of two versions of the integrated circuit, which requires a significant amount of work and is relatively expensive. Further, the final chip is not necessarily identical to the tested chip.
To overcome the above-mentioned disadvantages, it is desired to form a monitoring circuit 18 which takes up a reduced surface area and only requires a reduced number of test terminals 22, which decreases the selfcost of the monitoring circuit. Monitoring circuit 18 can then be left on the finally sold integrated circuit 10.
It is thus desired to decrease the number of signals provided by monitoring circuit 18. For this purpose, certain logic operations are directly performed at the level of monitoring circuit 18 on the data measured at the level of microprocessor 12 to only transmit messages having an important information content.
Thus, standard IEEE-ISTO-5001 in process provides in its 1999 version a specific message exchange protocol between a monitoring circuit and an analysis tool for a monitoring circuit 18 requiring but a reduced number of test terminals 22.
The monitoring circuit is provided to monitor the operation of the microprocessor and to provide the test terminals with predetermined messages only corresponding to the execution of certain predetermined instructions. Several types of messages are provided, which correspond to the execution of instructions of different types. The different types of messages and their structure are described in section 6 of standard IEEE-ISTO-5001.
A great number of messages may be generated within a reduced time interval. The standard provides for each new message to be buffered when the test terminals are not available (when they are used to transmit another message), then to be sent to the analysis tool when the test terminals are available. When a message comprises more bits than there are test terminals, the standard provides for the message to be divided into segments of appropriate size, which are sequentially sent by the test terminals. Thus, the larger a message, the more time is required to send it to the analysis tool. The analysis tool is provided to reconstitute the microprocessor operation, that is, the program execution in the microprocessor, based on the received messages and on the program code. A problem results from the fact that, although the analysis tool easily determines the time elapsed between the reception of two messages, the analysis tool has no means to determine the time elapsed between the storage of these two messages. Indeed, the analysis tool receives each message at a reception time which has no relation with the time at which each message has been stored by circuit 18. Between the time at which a message is stored and the time at which this message is received by the analysis tool, the message remains in the buffer memory for a variable time period which depends on many factors, such as the size and the number of messages previously stored in the buffer memory. A given type of message provided by the terminal does indicate the number of instructions executed by the microprocessor since a previous message of the same type, but the speed at which the microprocessor executes the instructions varies from one instruction to the other, and the number of instructions executed between two messages just enables evaluating the time elapsed between these two messages. It is however desirable to accurately measure the time elapsed between the storage of two messages, especially to measure the execution time of certain critical portions of the microprocessor program.
To measure the time elapsed between the storage of two messages, a solution consists of including, in monitoring circuit 18, a counter rated at a predetermined frequency, with a counting that varies along time. It is enough to add in each message a data field containing the counting at the time when each message is stored to date this time. However, for such a dating to be sufficiently accurate, the counter must be rated at a high frequency. The counting thus very rapidly increases and the counter must have a large size not to be saturated. Such a counter takes up a significant surface area, which is not desirable. Further, the introduction of the counting in the messages substantially increases the message size. The messages comprising the counting must be divided into a large number of segments, the transmission of which monopolizes the test terminals for a long time, which is not desirable.